<template>
  <!--房间图片展示-->
  <div class="overall">
    <div class="show">
      <div class="home-banner">
        <mt-swipe :auto="4000">
          <mt-swipe-item v-for="(item,index) in roomDetail.pictureList" :key="'picture'+index">
            <img slot="" :src="item" class="imgDetail" style="width:100%;height:100%;">
          </mt-swipe-item>
        </mt-swipe>
      </div>
      <!--房间信息-->
      <div class="head" >
        <div class="head_top" >
          <h3><mt-cell :title="roomDetail.organizationName"></mt-cell></h3>
        </div>
      </div>
      <div class="price">
        <span class="num" ><mt-cell :title="roomDetail.roomRental*0.8+'元/月'" class="unit">
          <span class="price_foot" >原价:{{roomDetail.roomRental}}元/月</span></mt-cell></span>
        <!-- <div class="head_border" style="padding:0 0 4% 0;">
          <span >WIFI</span>
          <span >智能锁</span>
        </div> -->
      </div>
    </div>

    <!--房屋信息-->
    <div class="housings orientation">
      <div class="white-space decline"></div>
      <div class="housings-hd top_hasi">
        <h3>房屋信息</h3>
      </div>
      <div class="housings-bd">
        <div class="housings-list">
          <div class="details-list degrees_1">
            物业地址：<span>{{roomDetail.address}}</span>
          </div>
          <div class="details-list degrees_2">
            房屋户型：<span>{{roomDetail.roomType}}</span>
          </div>
          <div class="details-list degrees_2">
            房屋朝向：<span>{{roomDetail.face}}</span>
          </div>
          <div class="details-list degrees_2">
            房屋面积：<span>{{roomDetail.area}}㎡</span>
          </div>
          <div class="details-list degrees_2">
            所属楼层：<span>第{{roomDetail.floor}}层/共{{roomDetail.totalFloor}}层</span>
          </div>
        </div>
      </div>
    </div>
    <div class="white-space decline"></div>
    <!--房屋标配-->
    <div class="housings">
      <div class="housings-hd">
        <h3>房屋标配</h3>
      </div>
      <div class="housings-bd">
        <div class="housings-list">

          <div v-for="(item,index) in roomDetail.stateList" :key="index" :index="index.toString()+1" >
          <div class="standard-list" v-if="item == 0"><img src="../../../assets/phone/icon/bed.png" alt=""><span>床</span></div>

          <div class="standard-list" v-if="item == 1"><img src="../../../assets/phone/icon/yigui.png" alt=""><span>衣柜</span></div>

          <div class="standard-list" v-if="item == 2"><img src="../../../assets/phone/icon/shuzhuo.png" alt=""><span>书桌</span>
          </div>

          <div class="standard-list" v-if="item == 3"><img src="../../../assets/phone/icon/chugui.png" alt=""><span>橱柜</span>
          </div>

          <div class="standard-list" v-if="item == 4"><img src="../../../assets/phone/icon/conditioner.png" alt=""><span>空调</span>
          </div>

          <div class="standard-list" v-if="item == 5"><img src="../../../assets/phone/icon/reshuiqi.png" alt=""><span>热水器</span>
          </div>

          <div class="standard-list" v-if="item == 6"><img src="../../../assets/phone/icon/xiyiji.png" alt=""><span>洗衣机</span>
          </div>

          <div class="standard-list" v-if="item == 7"><img src="../../../assets/phone/icon/bingxiang.png" alt=""><span>冰箱</span>
          </div>

          <div class="standard-list" v-if="item == 8"><img src="../../../assets/phone/icon/wifi.png" alt=""><span>WIFI</span>
          </div>

          <div class="standard-list" v-if="item == 9"><img src="../../../assets/phone/icon/chouyouyanji.png"
                                          alt=""><span>油烟机</span></div>
          </div>

        </div>
      </div>
    </div>
    <div class="white-space decline"></div>

    <!--我的室友-->


    <!--特色配套-->
    <div class="housings">
      <div class="housings-hd">
        <h3>特色配套</h3>
      </div>
      <div class="housings-bd">
        <div class="housings-list">
          <div class="standard-list-mating"><img src="../../../assets/phone/icon/guanjiafuwu.png"
                                                 alt=""><span>管家服务</span></div>
          <div class="standard-list-mating"><img src="../../../assets/phone/icon/shenghuochaoshi.png"
                                                 alt=""><span>生活超市</span></div>
        </div>
      </div>
    </div>
    <div class="white-space decline"></div>
    <!--备注说明-->
    <div class="housings">
      <div class="housings-hd">
        <h3>备注说明</h3>
      </div>
      <div class="housings-bd">
        <div class="housings-list">
          <div class="explain">
            <p></p>
          </div>
          <div class="plot">
            <a
              href="/phonehtml/findHousingController/findHousingListNew.action?companyid=Company_20170806105236JeUAyW&amp;keyword=菜鲜丰星级市场">查看本小区其他房源</a>
          </div>
        </div>
      </div>
    </div>
    <div class="white-space decline"></div>
    <!--地图导航-->
    <!-- <div class="housings to_get">
      <div class="housings-hd">
        <h3>地图导航</h3>
      </div>
      <div class="housings-bd">
            <el-amap
              vid="amapDemo2"
              :center="center"
              :zoom="zoom"
              class="amap-demo"
              :events="events">
            </el-amap>
            <div class="toolbar">
              地址: {{ this.roomDetail.address }}
            </div>
      </div>

    </div> -->
    <!--预约看房，联系看房-->
    <div class="white-space decline_hir">
      <div class="disturb">
        <a class="subscribe" href="jacascript:void(0)" onclick="appointment('QftHousing_20181130142756JO2R6F')"><span>预约看房</span></a>
        <a class="phone" href="tel:13877171152"><span>联系我们</span></a>
      </div>
    </div>
  </div>
</template>
<script>
  import 'swiper/dist/css/swiper.css'
  import VueAMap from 'vue-amap'
  import {postAction,getAction} from '@/api/manage'
  import noPicture from '@/assets/nopicture.jpg'
  import { Swipe, SwipeItem } from 'mint-ui'

  export default {
    name: 'text',
    components: {
      Swipe,
      SwipeItem
    },
    data() {
      let self = this;
      let amapManager = new VueAMap.AMapManager();
      return {
        galleryElements: '',
        selected: '首页',
        search: '',
        roomDetail: {
          // organizationName: '江南菜鲜丰星级市场',
          // roomRental: 1780,
          // address: '江南区菜鲜丰星级市场2【23-7】',
          // roomNum: '23-7',
          // roomType: '一室一厅',
          // face: '朝东',
          // area: 20.00,
          // floor: 23,
          // totalFloor: 25,
          // roomConfiguration: '0,1,2,3,4,5,6,7,8,9',
          // longitude: 121.59996,
          // latitude: 31.197646
        },
        roomId: null,
        amapManager,
        zoom: 12,
        center: [121.59996, 31.197646],
        address: '',
        events: {
          init(o) {
            let marker = new AMap.Marker({
              position: [121.59996, 31.197646]
            });

            marker.setMap(o);
          }
        },
        lng: 0,
        lat: 0,
        url:{
          list:"/buildingManagement/page/queryById"
        }
      }

    },
    mounted: function() {
    },
    computed: {},
    created() {
      this.roomId = this.$route.query.id
      this.getRoomDetail(this.roomId)
    },
    methods: {
      getRoomDetail(value){
        getAction(this.url.list, {id:value}).then((res) => {
          if (res.success) {
            let result = res.result
            if (!result.pictureList.length) {
              result.pictureList.push(noPicture)
            } else {
              result.pictureList = result.pictureList.map(item=>{
                return window._CONFIG['domianURL']+'/'+item.pictureUrl
              })
            }
            result.stateList = result.roomConfiguration.toString().split(',')
            this.roomDetail = result
            console.log(this.roomDetail);
            
          }
          if (res.code === 510) {
            this.$message.warning(res.message)
          }
        })
      },
      add() {
        let o = this.amapManager.getMap();
        let marker = new AMap.Marker({
          position: [121.59996, 31.177646]
        });

        marker.setMap(o);
      }
    }
  }

</script>
<style>
  .amap-demo {
    height: 300px !important;
  }
  /*轮播图banner样式*/
  .home-banner {
    /*margin-top:45px;*/
    height: 250px;
  }

  imgDetail {
    width: 100%;
    height: 100%;
  }

  * {
    margin: 0;
    padding: 0;
  }

  body,
  html {
    font: 12px/1.5 'Microsoft YaHei';
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
  }

  a {
    background: none;
    border: none;
    outline: none;
  }

  a:link,
  a:visited,
  a:active,
  a:hover {
    text-decoration: none;
    outline: none;
  }

  a,
  body,
  div,
  em,
  font,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  hr,
  html,
  iframe,
  img,
  li,
  menu,
  object,
  ol,
  p,
  pre,
  span,
  strong,
  thead,
  u,
  ul {
    border: 0;
    margin: 0;
    padding: 0;
  }

  b,
  strong {
    font-weight: bold;
  }

  img {
    border: none;
    outline: none;
  }

  ol,
  ul,
  li {
    list-style: none;
  }

  table {
    border-collapse: collapse;
    word-wrap: break-word;
    table-layout: fixed;
  }

  input:-webkit-autofill,
  textarea:-webkit-autofill,
  select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px white inset;
  }

  tr,
  th,
  td,
  caption {
    font-weight: normal;
    text-align: left;
    border-spacing: 0;
    padding: 0;
    margin: 0;
  }

  input,
  button {
    outline: none;
    padding: 0;
    margin: 0;
  }

  /*去除IE10的清空文本框按钮“X”*/
  input::-ms-clear {
    display: none;
  }

  input:focus {
    outline: none;
    border: none;
  }

  .left {
    float: left;
  }

  .right {
    float: right;
  }

  i,
  em {
    font-style: normal;
  }

  .clearfix {
    *zoom: 1;
  }

  .clearfix:before,
  .clearfix:after {
    content: " ";
    display: table;
  }

  .clearfix:after {
    clear: both;
    visibility: hidden;
    height: 0;
  }

  .relative {
    position: relative;
  }

  .absolute {
    position: absolute;
  }

  .fixed {
    position: fixed;
  }

  .hide {
    display: none;
  }

  /*.behaviorBg {*/
  /*  -ms-behavior: url("backgroundsize.min.htc");*/
  /*  behavior: url("backgroundsize.min.htc");*/
  /*}*/
  /*.behavior {*/
  /*  behavior: url("PIE.htc");*/
  /*}*/
  .behavior-relative {
    position: relative;
    z-index: 1;
  }

  .box-sizing {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
  }

  body {
    background-color: #FFFFFF;
  }

  .white-space {
    height: 30px;
  }

  .decline {
    background-color: #f4f4f4;
  }

  .overall {
    position: relative;
    width: 100%;
    height: auto;
    background: #FFFFFF;
  }

  .show {
    margin-left: auto;
    margin-right: auto;
    max-width: 640px;
    width: 100%;
    background-color: #ffffff;
  }

  .show .swiper-slide img {
    max-width: 640px;
    width: 100%;
    height: 250px;
  }

  .head {
    display: block;
    padding: 15px 10px 0 10px;
    position: relative;
  }

  .head .head_top h3 {
    width: 100%;
    color: #333333;
    font-family: "Ping Fang - SC";
    font-size: 19px;
    font-weight: 500;
    text-overflow: ellipsis;
  }

  .price {
    margin: 0 10px 20px 10px;
    color: #ff594c;
  }

  .price .num {
    font-family: "Ping Fang - SC - Heavy";
    font-size: 18px;
    font-weight: 800;
    color: #ff594c;
  }
  .unit {
    font-size: 14px;
    font-weight: 400;
    color: #ff594c !important;
  }

  .price .unit {
    font-size: 14px;
    font-weight: 400;
  }

  .price .price_foot {
    font-size: 10px !important;
    /*margin-left: 1%;*/
    color: #333333;
    text-decoration: line-through;
    font-weight: 400;
  }

  .price .head_border {
    padding: 2% 0;
    background-color: #FFFFFF;
  }

  .price .head_border span {
    float: left;
    margin: 1% 1%;
    border-radius: 6px;
    background-color: #e7f4ff;
    color: #68b3ff;
    font-family: "Ping Fang - SC";
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    padding: 5px 8px;
  }

  .housings {
    background: #ffffff;
  }

  .housings .housings-hd {
    display: flex;
    align-items: center;
    height: 44px;
    border-bottom: 1px solid #dcdcdc;
    padding: 0 10px;
  }

  .housings h3 {
    font-size: 16px;
    color: #333333;
    font-weight: normal;
    line-height: 18px;
    border-left: 3px solid #3696fe;
    padding-left: 7.5px;
  }

  .orientation {
    clear: both;
  }

  .housings-bd {
    padding: 10px 0;
  }

  .housings-bd .housings-list {
    display: block;
    overflow: hidden;
    height: 100%;
    position: relative;
    margin: auto 10px;
  }

  .housings-bd .housings-list .details-list {
    color: #999999;
    font-family: "Ping Fang - SC";
    font-size: 15px;
    font-weight: 300;
    line-height: 24px;
    text-transform: uppercase;
  }

  .housings-bd .housings-list .details-list span {
    color: #333333;
  }

  .degrees_1 {
    float: left;
    width: 100%;
  }

  .degrees_2 {
    float: left;
    width: 50%;
  }

  .standard-list {
    float: left;
    width: 33.3333333333%;
  }

  .standard-list img {
    max-width: 30px;
    width: 100%;
    height: 16%;
  }

  .standard-list span {
    position: absolute;
    margin: 1% 0.8%;
    color: #999999;
    font-family: "Ping Fang - SC";
    font-size: 15px;
    font-weight: 500;
    text-transform: uppercase;
  }

  .standard-list-mating {
    float: left;
    width: 33.333333333%;
  }

  .standard-list-mating img {
    max-width: 30px;
    width: 100%;
    height: 18%;
  }

  .standard-list-mating span {
    position: absolute;
    margin: 1% 1%;
    color: #ffb820;
    font-family: "Ping Fang - SC";
    font-size: 15px;
    font-weight: 500;
  }

  .explain {
    margin: auto 5%;
    color: #666666;
    font-family: "Ping Fang - SC";
    font-size: 15px;
    font-weight: 400;
  }

  .explain p {
    text-align: justify;
  }

  .plot {
    float: left;
    margin-left: 25%;
    margin-top: 5%;
    max-width: 350px;
    width: 50%;
    height: 20%;
    background-color: #3696fe;
    border-radius: 4px;
    text-align: center;
  }

  .plot a {
    color: #fefefe;
    font-family: "Ping Fang - SC";
    font-size: 15px;
    font-weight: 700;
    line-height: 40px;
  }

  .housings-map {
    display: block;
    overflow: hidden;
    height: 100%;
  }

  .map {
    position: relative;
    width: 100%;
    height: 20%;
  }

  .map img {
    width: 100%;
    height: 10%;
  }

  .map p {
    margin: auto 10px;
    padding-top: 2%;
    color: #333333;
    font-family: "Ping Fang - SC";
    font-size: 15px;
    font-weight: 400;
  }

  .to_get {
    margin-bottom: 12%;
  }

  .disturb {
    position: fixed;
    bottom: 0;
    width: 100%;
  }

  .disturb a {
    float: left;
    width: 50%;
    text-align: center;
    padding: 4% 0;
  }

  .disturb a span {
    color: #ffffff;
    font-family: "Ping Fang - SC";
    font-size: 16px;
    font-weight: 300;
  }

  .decline_hir {
    width: 100%;
  }

  .subscribe {
    background-color: #000c17;
    background-size: 16px 16px;
  }
  .phone {
    background-color: #2f54eb;
    background-size: 16px 16px;
  }
</style>